package org.tailor
/**
 * The Client entity.
 *
 * @author    
 *
 *
 */
class Client {
    static mapping = {
         table 'client'
         // version is set to false, because this isn't available by default for legacy databases
         version false
         id generator:'identity', column:'id'
    }
    Long id
    String account
    String activationKey
    String address
    Integer cardExMo
    Integer cardExYr
    String country
    Long creditCard
    Integer creditCardType
    Date dateCreated
    String email
    String fullName
    String password
    Integer phone
    Integer postalCode

    static constraints = {
        id(max: 9223372036854775807L)
        account(size: 6..255, blank: false)
        activationKey(size: 1..255, blank: false)
        address(size: 1..255, blank: false)
        cardExMo(inList: [1,2,3,4,5,6,7,8,9,10,11,12])
        cardExYr(inList: [2011,2012,2013,2014,2015,2016,2017,2018,2019,20120])
        country(size: 1..255, blank: false)
        creditCard(max: 10000000L)
        creditCardType(max: 2147483647)
        dateCreated()
        email(size: 1..255, blank: false)
        fullName(size: 1..255, blank: false)
        password(size: 6..255, blank: false)
        phone(max: 2147483647)
        postalCode(max: 2147483647)
    }
    String toString() {
        return "${fullName}" 
    }
}
